#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "dialog.h"


MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_pushButton_clicked()
{
    Dialog *dia = new Dialog(this);
    dia->setAttribute(Qt::WA_DeleteOnClose);
    // dia->show(); 非模态对话框
    dia->exec(); // 模态对话框
}

